const express = require('express');
var router = express.Router(),
    db = require('../lib/mysql');


router.get('/',function(req,res){
    var sql = 'select * from article where a_id="'+req.query.aid+'"';
    db.query( sql,function(err,data){

        if( err )
            res.status(500).send('database error').end();
        else
            res.render('zhengwen.ejs',{info:data});
    } );
   
});

module.exports = router;